package com.example.shengyin.dao;

import com.example.shengyin.entity.Symtype;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface SymtypeMapper {

    public List<Symtype> list(@Param("pagestart")int pagestart, @Param("limit") int limit);

    @Select("select * from d_symtype")
    public List<Symtype> allSymtyp();

    // 传id获取具体的symtype
    @Select("select * from d_symtype where id=#{id}")
    public Symtype select(@Param("id")Long id);

    @Insert("insert into d_symtype(symtype,poster,isvalid)values(#{symtype},#{poster},#{isvalid})")
    public int insert(Symtype symtype);

    @Update("update d_symtype set symtype=#{symtype},poster=#{poster},posttime=#{posttime},isvalid=#{isvalid} where id=#{id} ")
    public int update(Symtype Symtype);

    @Delete("delete from d_symtype where id=#{id}")
    public int delete(@Param("id") Long id);

    public int count();


    @Update("update d_symtype set isvalid=#{isvalid} where id=#{id}")
    public int updateIsvalid(@Param("isvalid")boolean isvalid,@Param("id")Long id);

    @Delete("delelte from d_symtype where id in ${ids}")
    public int deleteByIds(@Param("ids") String ids);


}
